<?php
//三方产液量数据模型
namespace app\admin\model;

use DateTime;
use think\facade\Log;

use app\common\model\TimeModel;

class OtherCyl extends TimeModel
{
    protected $connection = 'epbp';
    protected $table = 'YS_DBA01_BN';

    protected function initialize()
    {
        parent::initialize();
        if (env('UAT')===false) {
           $this->table = 'SJH_GXZT.'.$this->table;
        }
    }

    ///计算产油量
    public function getRclAttr($value, $data)
    {
        $cyl = floatval($data['RCYL1']);
        if ($cyl > 0) {
            $hs = floatval($data['HS']);
            $cl = ($cyl * (100 - $hs)) / 100;
            return formatNumber($cl);
        } else {
            return 0;
        }
    }
}
